package com.com.designpatterns.visitor;

import org.junit.*;

import java.util.logging.Logger;

/**
 * Created by pankaj on 7/13/14.
 */
public class TreeTester {

    static Logger logger = Logger.getLogger(TreeTester.class.getName());

    static {
        logger.setParent(Logger.getLogger(TreeTester.class.getPackage().getName()));
    }

    @BeforeClass
    public static void setUpOnce(){

    }

    @Before
    public void setUp(){

    }

    @Test
    public void someTest(){
        Tree<Integer> t = Tree.branch(Tree.leaf(2), Tree.leaf(4));
        Assert.assertTrue(t.sum() == 8);
        Assert.assertTrue(t.toString().equals("(2 ^ 4)"));
    }

    @After
    public void tearDown(){
        // clean up fixtures if necessary i.e non memory resources connections files
    }

    @AfterClass
    public static void tearDownOnce(){
        // clean up just once
    }
}

